﻿// License Notification
//======================================================
// Copyright (c) 2010 Channel Intelligence Inc.
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// which accompanies this distribution, and is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// ======================================================




using System;
using System.Collections.Generic;
using CIP4.Common;
using MassTransit;

namespace CIP4.DataProvider.MassTransit
{
    [Serializable]
    public class ResponseMessage :
        CorrelatedBy<Guid>
    {
        public string CorrelationTag { get; set; }

        public MajorEnum Status { get; set; }
        public MinorEnum MinorStatus { get; set; }
        public string Message { get; set; }
        public List<object> Paras { get; set; }

        public Guid CorrelationId { get; set; }

        public List<object> Values { get; set; }

        public override string ToString()
        {
            return string.Format("{0}.{1} - {2} - #items {3}", 
                Status, 
                MinorStatus, 
                string.Format(Message??"no message", Paras != null? Paras.ToArray():new object[]{}),
                Values == null? 0 : Values.Count);
        }
    }
}
